﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<z.m.db.Occasion_Detail>" %>

<% if (ViewData["type"] == "header") {%>
<tr>
	<td rowspan="2"><%: Html.LabelFor(m=>m.ID) %></td>
	<td colspan="2"><%:Html.LabelFor(m=>m.Product)%></td>
	<td rowspan="2" colspan="99">Controll</td>
</tr>
<tr>
	<td><%:Html.LabelFor(m=>m.Product.ID)%></td>
	<td><%:Html.LabelFor(m=>m.Product.Name)%></td>
</tr>
<%} else if (ViewData["type"] == null) {%>
<tr id="oc_dt<%:Model.ID%>" data-id="<%:Model.ID%>">
	<td>
		<div class="img">
			<img src="<%:Url.Content("~/Content/img/p/"+Model.Product_ID+".jpg") %>" />
		</div>
		<input name="ID" readonly="true" type="text" value="<%:Model.ID %>" />
	</td>
	<td>
		<input name="Occasion_ID" readonly="true" value="<%:Model.Occasion_ID %>" type="text" class="collapse" />
		<%:Html.TextBoxFor(m => m.Product_ID, new {@readonly=true,@class="number" })%>
	</td>
	<td>
		<%:Html.TextBoxFor(m=>m.Product.Name, new {@readonly=true,@class="number" }) %>
		<input value="Product" type="button" onclick="
	elPID=el('#oc_dt<%:Model.ID%>	[name=\'Product_ID\']');
	openPID();" />
	</td>
	<td>
		<input type="button" value="<%:Model.ID==0?"Add":"Save" %>" onclick='ajaxTrSubmit(event);' <%:Model.ID==0&&Model.Product_ID==0?"disabled":"" %>/>
	</td>
	<td>
		<input type="button" value="Delete" onclick='ajaxTrBtn(event,"Delete");' />
	</td>
</tr>
<%}%>